package com.xfcy.blog.entity;

import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xfcy.blog.common.constant.DateConstant;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;

/**
 * 系统管理-权限资源表 (Menu)表实体类
 *
 * @author 晓风残月Lx
 * @since 2023-04-09 11:03:05
 */
@TableName("b_menu")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Menu implements Serializable {
    //主键
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    //上级资源ID
    private Integer parentId;
    //url
    private String url;
    //资源编码
    private String component;
    //资源名称
    private String title;
    //资源级别
    private Integer level;
    //排序
    private Integer sortNo;
    //资源图标
    private String icon;
    //类型 menu、button
    private String type;
    //备注
    private String remarks;
    //创建时间
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = DateConstant.FORMAT_STRING,timezone=DateConstant.GMT_TIMEZONE)
    private LocalDateTime createTime;
    //更新时间
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = DateConstant.FORMAT_STRING,timezone=DateConstant.GMT_TIMEZONE)
    private LocalDateTime updateTime;
    //重定向地址
    private String redirect;
    //跳转地址
    private String name;
    //是否隐藏
    private String hidden;

    @TableField(exist = false)
    private List<Menu> children;
}

